<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * @author Garry
 * THe IFrame controller is called from other views for asynchronous operations as required
 *
 */
class IFrameOperation extends page {
	//TODO - Insert your code here


	/**
	 *
	 */
	public  function __construct() {
		$this->verify();
		parent::__construct();
		$this->display =  new PageDisplay();
		$this->load->database();
		$this->load->helper('url');
		$this->load->library('form_validation');
		$this->load->library('encrypt');
		$this->load->helper(array('form', 'url','path','file'));
		$this->load->library('form_validation');
		$this->load->helper('Utils');
		$this->load->model('GalleryModel','gmodel');
		$this->display->scripts = 'jquery.js';
		$this->display->scripts = 'jquery-ui.js';
		$this->display->scripts = 'lightbox.js';
		$this->display->scripts = 'uiinit.js';
		$this->display->styles = 'ui';
		$this->display->styles = 'themes/smoothness/jquery.ui.all';
		$this->display->styles = 'lightbox';
		$this->display->styles = 'common';
		
		//TODO - Insert your code here
	}
	/**
	 * 
	 * this Iframe allows a user to upload images
	 * embedded into other page
	 * @param int $catid
	 */
	public function SimpleUpload($catid){
		$upload = $this->input->post('upload_submitted');
		$this->display->errors = null;
		$this->display->base = "imageAdmin/simpleUpload";
		$ci = & get_instance();
		$imagesadmin = new SimplifiedImageAdmin($ci,$catid);
		$this->display->uploadCtrl = $imagesadmin->display->content;
		$this->output();
	}
	private function verify(){
		session_start();
/*		if( empty($_SESSION['logged_in']) && $_SESSION['logged_in']!= TRUE ){
			$this->logout();
		}*/
	}
	/**
	 * 
	 * The output method is used by pages to generate appropriate views
	 * This is an override of standard
	 */
	public function output( ){
		$this->display->pagecontent = 'imageAdmin/simpleUpload';
		$this->display->finalize();
	}
}


?>